﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MsgBrd.aspx.cs" Inherits="MessageBoard_Default" Title="留言板" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/jscript">
     function check()
     {
          var ckbx = document.getElementById("cb_IsAnony");  
          var tbNam = document.getElementById("tb_UserName").value;   
          
          if(!ckbx.checked && tbNam == "" )
          {
             var divAlert = document.getElementById("divAlert");
             divAlert.innerHTML = "请输入用户名或选择匿名发表";
             return false;   
          }
          
          return true;
     }
</script>
<div class="msg">
<div class="msgheader">
    共<asp:Label ID="lbl_Count" Text="0" runat="server"></asp:Label>条留言
</div>
<div>
    <asp:Repeater ID="rp_Msgs" runat="server">
        <ItemTemplate>
            <div >
                <div class="msgtitle">
                    <%#Eval("CreateTime")%>&nbsp&nbsp<%#Eval("UserName")%>&nbsp&nbsp<%#Eval("IP")%>
                </div>
                <div class="msgcontent" >
                    <asp:Literal runat="server" ID="Label1" Text='<%#spbtzb.AuthenCtr.Decode(Eval("Content").ToString())%>'
                        Visible="true"></asp:Literal>
                </div>
            </div>
        </ItemTemplate>
        
    </asp:Repeater><div class="buttonlist" id="dvbtn" runat="server">第&nbsp;<asp:Label ID="lbCurPage" runat="server" Text="Label"></asp:Label>&nbsp;页
<asp:Button Text="前一页" ID="btnPreviousPage"  runat="server" OnClick="btnPreviousPage_Click"/>
<asp:Button Text="后一页" ID="btnNextPage"  runat="server" OnClick="btnNextPage_Click"/></div>
</div>
<div class="msgmodel">
<div style="height:37px;">姓名: <asp:TextBox ID="tb_UserName" runat="server"></asp:TextBox>
<asp:CheckBox ID="cb_IsAnony" runat="server" Text="匿名发表" /></div>
<div style="vertical-align:top;"><asp:TextBox ID="tb_Content" TextMode="MultiLine" runat="server" Height="112px" Width="780px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="内容不能为空"
 ControlToValidate="tb_Content" ValidationGroup="vcontent"></asp:RequiredFieldValidator></div>
 <div style="text-align:right; padding-right:25px;">
 <asp:Button ID="btok" runat="server" Text="提交留言" OnClientClick="return check();" OnClick="btok_Click" ValidationGroup="vcontent"/>
 </div>
<div id="divAlert" runat="server">
</div>
</div>
</div>        
</asp:Content>

